package short_semester.questionnaire_planet.response.AnalyseController;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import short_semester.questionnaire_planet.pojo.MultiChoiceOption;
import short_semester.questionnaire_planet.pojo.ScoreOption;
import short_semester.questionnaire_planet.pojo.SingleChoiceOption;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OptionAnalyseResponse {
    private Integer optionId;

    private String text;

    private Integer score;

    private Integer optionAmount = 0;
    
    public OptionAnalyseResponse(SingleChoiceOption option){
        optionId = option.getId();
        text = option.getText();
        optionAmount = option.getCount();
    }

    public OptionAnalyseResponse(MultiChoiceOption option){
        optionId = option.getId();
        text = option.getText();
        optionAmount = option.getCount();
    }

    public OptionAnalyseResponse(ScoreOption option){
        optionId = option.getId();
        text = option.getText();
        optionAmount = option.getCount();
        score = option.getScore();
    }
}